package com.yjhb.android.sbz.mvp.mypromotionfriend;

import com.yjhb.android.sbz.entity.FriendMoney;
import com.yjhb.android.sbz.http.HttpObserver;
import com.yjhb.android.sbz.http.HttpTool;
import com.yjhb.android.sbz.mvp.ConventionPresenter;
import com.jojo.android.zxlib.base.mvp.CommonView;

/**
 * 创建者 zx
 * 创建时间 2021/2/2 10:23
 */
public class PromotionFriendsPresenter extends ConventionPresenter<CommonView<FriendMoney>> {


    public PromotionFriendsPresenter(CommonView<FriendMoney> friendMoneyCommonView) {
        super(friendMoneyCommonView);
    }

    @Override
    protected void onDestroy() {

    }

    public void getFriendMoney() {
        HttpTool.request(model.getFriendShareCount(), new HttpObserver<FriendMoney>() {
            @Override
            public void onResult(FriendMoney data) {
                if (view != null) {
                    view.onSuccess(data);
                }
            }

            @Override
            public void onError(int code, String msg) {
                if (view != null) {
                    view.onFailure(code, msg);
                }
            }
        });
    }
}
